package com.ronghuanet.gift.client;

import com.ronghuanet.gift.dto.RegisterPhoneValidateDto;
import com.ronghuanet.gift.util.AjaxResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "gift-common",fallbackFactory = SmsValidateCodeClientFallbackFactory.class)
public interface SmsValidateCodeClient {

    // 注册验证码
    @GetMapping("/sms/{phone}")
    public AjaxResult sendRegisterCode(@PathVariable("phone") String phone);

    @PostMapping("/sms/validate")
    AjaxResult validateRegisterCode(@RequestBody RegisterPhoneValidateDto dto);
}
